package br.com.ecomm.model.rn;

import br.com.ecomm.model.dao.ClienteDAO;
import br.com.ecomm.model.dao.daoImpl.ClienteDAOImpl;
import br.com.ecomm.model.entity.Cliente;

public class ClienteRN {
	
		private ClienteDAO clienteDAO;
		private Cliente cliente;
		
		public ClienteRN() {
			clienteDAO = new ClienteDAOImpl();
			cliente = new Cliente();
		}

		public ClienteDAO getClienteDAO() {
			return clienteDAO;
		}

		public void setClienteDAO(ClienteDAO clienteDAO) {
			this.clienteDAO = clienteDAO;
		}

		public Cliente getCliente() {
			return cliente;
		}

		public void setCliente(Cliente cliente) {
			this.cliente = cliente;
		}
		
		public boolean valida(){
			//implementa validacao
			
			return true;
		}
		
		
		public void salvar(){
			if(valida()){
				 clienteDAO.addCliente(cliente);
			}else{
				//manda erro pra tela
			}
			
		}
		
		
		
		
}
